package com.studychen.appfxcp.commom.model;

import com.studychen.appfxcp.commom.vo.BookkeepingItem;
import de.saxsys.mvvmfx.SceneLifecycle;
import de.saxsys.mvvmfx.ViewModel;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import lombok.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Data
public class BookkeepingListModel  implements ViewModel, SceneLifecycle {

    private static final Logger log = LoggerFactory.getLogger(BookkeepingListModel.class);
    private final ObservableList<BookkeepingItem> items = FXCollections.observableArrayList();

    @Override
    public void onViewAdded() {
        BookkeepingItem item1 = new BookkeepingItem("1", "老王", "526.36", "伍佰贰拾陆点叁陆圆", "地区1", "哈哈哈1");
        BookkeepingItem item2 = new BookkeepingItem("2", "老李", "526.36", "伍佰贰拾陆点叁陆圆", "地区2", "哈哈哈1");
        BookkeepingItem item3 = new BookkeepingItem("3", "老陈", "526.36", "伍佰贰拾陆点叁陆圆", "地区3", "哈哈哈1");
        BookkeepingItem item4 = new BookkeepingItem("4", "马云", "526.36", "伍佰贰拾陆点叁陆圆", "地区4", "哈哈哈1");
        BookkeepingItem item5 = new BookkeepingItem("5", "王建林", "526.36", "伍佰贰拾陆点叁陆圆", "地区5", "哈哈哈1");
        items.addAll(item1, item2, item3, item4, item5);
    }

    @Override
    public void onViewRemoved() {

    }
}
